<extend name="base/common"/>

<block name="style">
    <link href="__CSS__/index.css" rel="stylesheet" type="text/css"/>
</block>

<block name="body">

<div id="page">
	<div class="ucenter-module-hd">
		<h2>修改密码</h2>
		<div class="operation">
		</div>
	</div>

	<div class="ucenter-module-layout clearfix" id="ucenter-module-layout">
		<form id="changePasswordForm"  action="{:U('Ucenter/Config/doChangePassword')}" method="post" class="ajax-form layui-form layui-form-pane">
			
			<div class="layui-form-item">
				<label class="layui-form-label" for="inputOldPassword">旧密码</label>
				<div class="layui-input-inline">
					<input type="password" name="old_password" id="inputOldPassword" required="" lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
				</div>
				<div class="layui-form-mid layui-word-aux"></div>
			</div>
			
			<div class="layui-form-item">
				<label class="layui-form-label" for="inputNewPassword">新密码</label>
				<div class="layui-input-inline">
					<input type="password" name="new_password" id="inputNewPassword" required="" lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
				</div>
				<div class="layui-form-mid layui-word-aux"></div>
			</div>
			
			<div class="layui-form-item">
				<label class="layui-form-label" for="inputConfirmPassword">确认密码</label>
				<div class="layui-input-inline">
					<input type="password" name="confirm_password" id="inputConfirmPassword" required="" lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
				</div>
				<div class="layui-form-mid layui-word-aux"></div>
			</div>
			
			<div class="layui-form-item">
				<button class="layui-btn" lay-submit="*" lay-filter="formDemo">立即提交</button>
			</div>
			
		</form>
	</div>
</div>
</block>
<block name="script">
    <script>
        //检查两次输入的密码是否一致
        $(function(){
            $('#changePasswordForm').submit(function(e){
                var newPassword = $('#inputNewPassword').val();
                var confirmPassword = $('#inputConfirmPassword').val();
                if(newPassword != confirmPassword) {
					layer.msg('两次输入的密码不一致', {icon: 2, fixed: true, offset: '80%', time: 1000});
                    e.stopPropagation();
                    return false;
                }
            })
        })
    </script>
</block>